﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="m_leftmenu.ascx.cs" Inherits="administrator_uc_admin_m_leftmenu" %>
<%@ Register src="~/administrator/uc_admin/mn_top.ascx" tagname="mn_top" tagprefix="uc1" %>
<%@ Register src="~/administrator/uc_admin/mn_bottom.ascx" tagname="mn_bottom" tagprefix="uc2" %>
<div id="managecontent">
    <div id="managecontent_title">
        <h3>QUẢN LÝ MENU TRÁI</h3>
    </div>
    <br class="clrfix" />
    <div id="managecontent-header">
        <div id="managecontent_feature">
        <script language="javascript">
             function CallFuncEditItem() {
                 document.getElementById('<%= btnEditItem.ClientID%>').click();
             }
             function CallFuncDeleteItem() {
                 if (confirm('Bạn có muốn xóa không?')) {
                     document.getElementById('<%= btnDeleteItem.ClientID%>').click();
                 }
             }
        </script>
        <uc1:mn_top ID="mn_top" runat="server" /> 
        </div>
        <div id="managecontent_search">
            <asp:Literal ID="ltresultSearch" runat="server"></asp:Literal>
            <asp:DropDownList ID="DropDownListSearch" runat="server" AppendDataBoundItems="true">
                <asp:ListItem Value="0">---Chọn menu cha---</asp:ListItem>
            </asp:DropDownList>
            <asp:TextBox ID="txtKeyWord" runat="server"></asp:TextBox>
            <asp:LinkButton ID="lbtSearch" runat="server"            
                onclick="lbtSearch_Click">
                <img src="../images/icons/icon_search.gif" border="0px" /><b>Tìm Kiếm</b>
            </asp:LinkButton>
        </div>
    </div>
    <br class="clrfix" />
    <asp:GridView ID="gv_ManageControl" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="MenuID,ParentID" Width="910px" AllowPaging="True"
        onpageindexchanging="gv_ManageControl_PageIndexChanging" PageSize="20" 
        AllowSorting="True" onsorting="gv_ManageControl_Sorting">
        <Columns>
             <asp:TemplateField>
                <HeaderTemplate>
                    <input id="checkAll" style="float:left;" onclick="javascript:SelectAllCheckBoxes(this);" 
                          runat="server" type="checkbox" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="chkCheck" runat="server" />
                    <asp:HiddenField ID="hdItemKeyFieldID" runat="server" Value='<%#Bind("MenuID") %>' />
                </ItemTemplate>
            </asp:TemplateField>           
             <asp:BoundField DataField="_Title" HeaderText="Tiêu đề" SortExpression="Title" />
             <asp:BoundField DataField="Url" HeaderText="Liên kết" />
             <asp:BoundField DataField="_Active" HeaderText="Hiển thị" />
            <asp:TemplateField HeaderText="Xem">
                <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate> 
                 <a href="javascript:ViewItem('v_leftmenu','ViewItem','<%# Eval("MenuID") %>','560','300');" title="Xem"><img src="../images/icons/icon-view.png" border="0px"/></a>            
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Sửa">
                <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate> 
                 <a href="javascript:EditItem('e_leftmenu','EditItem','<%# Eval("MenuID") %>','560','300');" title="Sửa"><img src="../images/icons/icon_edit.bmp" border="0px"/></a>            
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Xóa">
            <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate>
                 <a href="javascript:DeleteItem('tbl_LeftMenu','MenuID','ParentID','<%# Eval("MenuID") %>', '<%# Eval("_Title") %>','1');" title="Xóa"><img src="../images/icons/icon_delete.jpg" border="0px"/></a>                        
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="Silver" />
        <HeaderStyle Font-Bold="True" BackColor="Silver" Font-Size="14px" Height="26px"/>
        <PagerSettings FirstPageText="trang đầu-" LastPageText="-trang cuối" 
            Mode="NumericFirstLast" NextPageText="-trang sau-" 
            PreviousPageText="-trang trước-" Position="TopAndBottom" />
        <PagerStyle BackColor="Silver" />
        <RowStyle Height="25px" CssClass="rowStyle" />
    </asp:GridView>
    <br class="clrfix" />
    <div id="AddNewItem">
        <uc2:mn_bottom ID="mn_bottom" runat="server" />
        <asp:HiddenField ID="hdItemID" runat="server" />
        <asp:Button ID="btnEditItem" runat="server" CssClass="featurehidden" onclick="btnEditItem_Click" />
        <asp:Button ID="btnDeleteItem" runat="server" CssClass="featurehidden" onclick="btnDeleteItem_Click" />
    </div>
</div>